package com.zsx.shopping.ware.controller;

import com.zsx.shopping.common.api.R;
import com.zsx.shopping.common.api.ware.vo.SkuStockVO;
import com.zsx.shopping.ware.service.WareSkuStockService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/ware/wareSkuStock")
public class WareSkuStockController {

    @Resource
    private WareSkuStockService wareSkuStockService;

    @GetMapping("/skuStock")
    public R<Map<Long, SkuStockVO>> getSkuStock(@RequestParam List<Long> skuIds) {
        return R.success(wareSkuStockService.getSkuStock(skuIds));
    }
}
